
<template>
    <div class="child">
        <h3>子组件</h3>
        <h4>玩具：{{ toy }}</h4>
        <h5>父给的车：{{car}}</h5>
        <button @click="sendToy(toy)">给父组件发送玩具</button>
    </div>
</template>
<script lang="ts" setup>
import {reactive} from 'vue';

let toy = reactive('奥特曼');
//接收父组件传的数据
defineProps(['car','sendToy']);


</script>

<style scoped>
.child {
    background-color: skyblue;
    padding: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}
</style>